<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('index')}">{:lang('商品列表')}</a></li>
        <li><a href="{:url('add')}">{:lang('添加商品')}</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="get" action="{:url('index')}">
        分类：
        <select class="form-control" name="cid">
            <option value="">全部</option>
            {$select_category}
        </select>
        商品名:
        <input type="text" class="form-control" name="keywords" style="width: 120px;"
               value="{:input('request.keywords','')}" placeholder="请输入{:lang('商品名')}">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('index')}">清空</a>
    </form>
    <style>tr th {
        text-align: center
    }</style>
    <form class="js-ajax-form" action="{:url('goodsorder')}" method="post">
        <table class="table table-hover table-bordered text-center">
            <thead>
            <tr>
                <th width="80">{:lang('SORT')}</th>
                <th>{:lang('商品标题')}</th>
                <th>{:lang('所属分类')}</th>
                <th>{:lang('封面')}</th>
                <th>{:lang('展示价格')}</th>
                <th>{:lang('状态')}</th>
                <th>{:lang('是否推荐')}</th>
                <th>{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="datas" item="data">
                <tr>
                    <td style='padding-left:20px;'>
                        <input name='list_orders[{$data.id}]' type='number' style="width: 80px;" class="text-center form-control"
                               value="{$data.list_orders}">
                    </td>
                    <td>{$data.title}</td>
                    <td>{$data.cname}</td>
                    <td>
                        <a href="javascript:imagePreviewDialog('{:cmf_get_image_url($data.img)}');">
                            <img src="{:cmf_get_image_url($data.img)}" height="30px;">
                        </a>
                    </td>
                    <td>{$data.showprice}</td>
                    <td>
                        <switch name="$data['status']">
                            <case value="1">上架中</case>
                            <case value="0">已下架</case>
                        </switch>
                    </td>
                    <td>
                        <switch name="$data['is_tuijian']">
                            <case value="1"><code>是</code></case>
                            <case value="0">否</case>
                        </switch>
                    </td>
                    <td>
                        <a href="{:url('edit',array('id'=>$data['id']))}" class="btn btn-info">编辑</a>
                        <a href="{:url('delete',array('id'=>$data['id']))}" class="js-ajax-delete btn btn-danger"
                           data-msg="确定将它放入回收站吗？">删除</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="table-actions">
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
        </div>
        <div class="pagination"> {$datas->render()}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>